package org.linys.dao.sale;

import java.util.List;

import org.apache.ibatis.session.SqlSession;
import org.linys.model.sale.SaleFee;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
@SuppressWarnings("unused")
@Repository
public class SaleFeeDAO {

	private SqlSession sqlSession;
	@Autowired
	public void setSqlSession(SqlSession sqlSession) {
		this.sqlSession = sqlSession;
	}
	public int save(SaleFee saleFee) {
		return sqlSession.insert("SaleFeeMapper.insert", saleFee);
	}
	public int update(SaleFee saleFee) {
		return sqlSession.update("SaleFeeMapper.update", saleFee);
	}
	
	public int deleteBySaleID(int saleID) {
		return sqlSession.delete("SaleFeeMapper.deleteBySaleID", saleID);
	}
	@SuppressWarnings("unchecked")
	public List<SaleFee> getBySaleID(Integer saleID) {
		return sqlSession.selectList("SaleFeeMapper.getBySaleID", saleID);
	}
	
}
